// 采用默认导入的方式引入 axios
import request from '@/utils/http.js'

// 定义获取分类数据的 API 函数
export function getCategoryAPI(id) {
    return request({
        url: '/category',
        params: {
            id
        }
    });
}

// 二级分类
export const getCategoryFilterAPI = (id) => {
    return request({
        url:'/category/sub/filter',
        params:{
            id
        }
    })
}

/**
 * @description: 获取导航数据
 * @data {
 categoryId: 1005000 ,
 page: 1,
 pageSize: 20,
 sortField: 'publishTime' | 'orderNum' | 'evaluateNum'
 }
 * @return {*}
 */
export const getSubCategoryAPI = (data) => {
    return request({
        url:'/category/goods/temporary',
        method:'POST',
        data
    })
}